Caching provides faster access to data than can be achieved by accessing data from regular random access memory (memory caches) or by accessing data from fast disk storage (disk caches). The purpose of a cache memory (cache) is to store program instructions and/or data that are used repeatedly in the operation of a computer system. The computer processor can access such information quickly from the cache rather than having to get it from computer's main memory, or from disk as the case may be, thus increasing the overall speed of the computer system.
A disk cache holds data that has recently been read and, in some cases, adjacent data areas that are likely to be accessed next. Write caching can also be provided with disk caches. Data is typically cached in units called blocks, which are the increments of data that disk devices use. Block sizes can be 512 Bytes, 1024 (1K) Bytes, 4K Bytes, etc.
How to design an efficient disk cache is a much investigated topic in both academia and industry. A global cache that is shared by multiple concurrent data objects on a distributed storage system presents some challenges. For example, it can be quite challenging to configure the global cache size, provide necessary cache resource isolation for each disk, fairly share the cache space, and ensure high cache hit ratio among all the disks under different I/O workloads. Blindly allocating a large cache with too many slots may not guarantee a higher cache hit ratio, and can also waste precious kernel memory space. On the other hand, insufficient cache space can result in excessive cache misses and I/O performance degradation. Moreover, a busy disk can eat up the cache space and lead to noisy neighbor issues.